import state from './state'
import getters from './getters'

const mutations = {
    showheader(state){
        state.header = true
    },
    hideheader(state){
        state.header = false;
    },
    showloading(state){
        state.loading = true;
    },
    hideloading(state){
        state.loading = false;
    },
    showfooter(state){
        state.footer = true;
    },
    hidefooter(state){
        state.footer = false;
    },

    // 登陆、退出
    login(state){
        sessionStorage.getItem('user')?state.logState = true:state.logState = false;
        // state.logState = log;
    },
    Logout(state){
        state.logState = false;
    },

    //test
    saveName(state,username){
        state.username = username;
    },


    searchRes(state,res){ //搜索结果
        state.searchRes = res;
    },

    emitHash(state,Hash){
        state.Hash = Hash;
    },
    SearchWord(state,keyword){
        state.keyword = keyword;
    },
    emitLyc(state,lyc){
        state.lyc = lyc;
    },

}
export default {
    state,
    getters,
    mutations
}